<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li><a href="/certificate/my">个人信息</a></li>
                <!-- <li><a href="/certificate/findApplyExam">报名记录</a></li> -->
                <li><a href="/certificate/infoRecordList">表单提交记录</a></li>
                <li><a href="/certificate/expertRecordList">专家申请记录</a></li>
                <li ><a href="/certificate/stationRecordList">考核站点申请记录</a></li>
                <li class="this"><a href="/certificate/stationPxRecordList">培训基地申请记录</a></li>
                <li><a href="/certificate/gradeQuery">成绩查询</a></li>
                 <li><a href="/certificate/message">消息中心</a></li>
                 <li><a href="/certificate/mock?grade=2" target="_blank">幼儿照护初级模拟考试</a></li>
                <li><a href="/certificate/mock?grade=1" target="_blank">幼儿照护中级模拟考试</a></li>
                <li><a href="/certificate/mock?grade=0" target="_blank">幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="div_2">
            <label class="label_title">培训基地申请记录</label>
            <hr/>
            <div id="news"></div>
            <div id="page"></div>
        </div>
        <div style="clear: both"></div>
    </section>
</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
</body>
<script>
    $(function () {
        ajaxToken("/jzApi/user/selMyExaminationPointListPx", 'GET',
            {
                current: 1,
                number: 8,
                t: new Date()
            }, function (res) {
            if (res.pages == 0) {
                $("#news").html('<div class="noData">暂无数据</div>');
            } else {
                var list = res.records;
                var news = '';
                list.forEach(function (item, index) {
                    var a = '';
                    var b = '';
                    var c = '';
                    b = '培训基地'

                    if (item.type == 0) {
                        a = '<span style="color: #005c34" id="state">草稿</span>';
                    }
                    if (item.type == 1) {
                        a = '<span style="color: blue" id="state">待审核</span>';

                    }
                    if(item.type == 2){
                        a = '<span style="color: green" id="state">已通过</span>';
                    }
                    if (item.type == 3) {
                        a = '<span style="color: red" id="state">未通过</span>';
                        c = '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">备注：</span><p style="color: red" class="title_2">' + item.examineRemarks + '</p></div>' +
                            '<div class="span_1" style="flex: 2;margin-top: 4px"><a href="/certificate/testingCentreApplyForPx?type=1" class="my_btn" style="flex: 1;text-align: center;padding:2px 10px"  >重新申请</a></div>' +
                            '</div>'
                    }
                    if (item.state == 9) {
                        a = '<span style="color: #2417ff" id="state">已删除</span>';
                    }

                    news += '<div class="my_bg div_01">' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">站点类型：</span><p class="title_2">' + b + '</p></div>' +
                            '<div class="span_1" style="flex: 2"><span class="title_1">审核状态：</span><p class="title_2">' + a + '</p></div>' +
                            '</div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">站点名称：</span><p class="title_2">' + item.enterpriseName + '</p></div>' +
                            '<div class="span_1" style="flex: 2"><span class="title_1">申请时间：</span><p class="title_2">' + item.createTime + '</p></div>' +
                            '</div>' +
                            c +
                            '</div>';


                });
                $("#news").html(news);
                page(1, res.pages);

            }
        })
    })

    function page(num, tolPages) {
        $("#page").paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 3, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/user/selMyExaminationPointListPx", 'GET',
                    {
                        current: num,
                        number: 8,
                        t: new Date()
                    }, function (res) {
                       // console.log(res);
                        var list = res.records;
                        var news = '';
                        list.forEach(function (item, index) {
                            var a = '';
                            var b = '';
                            var c = '';
                            b = '培训基地'

                            if (item.type == 0) {
                                a = '<span style="color: #005c34" id="state">草稿</span>';
                            }
                            if (item.type == 1) {
                                a = '<span style="color: blue" id="state">待审核</span>';

                            }
                            if(item.type == 2){
                                a = '<span style="color: green" id="state">已通过</span>';
                            }
                            if (item.type == 3) {
                                a = '<span style="color: red" id="state">未通过</span>';
                                c = '<div style="display: flex;justify-content: space-between">' +
                                    '<div class="span_1" style="flex: 6"><span class="title_1">备注：</span><p style="color: red" class="title_2">' + item.examineRemarks + '</p></div>' +
                                    '<div class="span_1" style="flex: 2;margin-top: 4px"><a href="/certificate/testingCentreApplyForPx?type=1" class="my_btn" style="flex: 1;text-align: center;padding:2px 10px"  >重新申请</a></div>' +
                                    '</div>'
                            }
                            if (item.state == 9) {
                                a = '<span style="color: #2417ff" id="state">已删除</span>';
                            }

                            news += '<div class="my_bg div_01">' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">站点类型：</span><p class="title_2">' + b + '</p></div>' +
                                '<div class="span_1" style="flex: 2"><span class="title_1">审核状态：</span><p class="title_2">' + a + '</p></div>' +
                                '</div>' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">站点名称：</span><p class="title_2">' + item.name + '</p></div>' +
                                '<div class="span_1" style="flex: 2"><span class="title_1">申请时间：</span><p class="title_2">' + item.applicantDate + '</p></div>' +
                                '</div>' +
                                c +
                                '</div>';
                        });
                        $("#news").html(news);
                });
            }
        });
    }

    function edit(id) {
        location.href = "/certificate/editStation?id=" + id
    }
</script>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</html>